package com.example.websocket.model;

import org.springframework.stereotype.Component;
import java.util.concurrent.ConcurrentHashMap;

@Component
public class MessageStore {
    private final ConcurrentHashMap<String, String> messageMap = new ConcurrentHashMap<>();

    public void storeMessage(String userId, String message) {
        messageMap.put(userId, message);
    }

    public String getMessage(String userId) {
        return messageMap.get(userId);
    }

    public void removeMessage(String userId) {
        messageMap.remove(userId);
    }
} 